<template lang="pug">
  .clearfix
    Modal(
      width="1200"
      v-model="isShowProgressModal"
      title="进度查看"
    )
      Table.beautiful-table(:columns="thead" :data="tableData" :stripe="true" ref="demoTable")

      .clearfix(slot="footer")
        Button(type="text" @click="cancel") 关闭
        //- Button(type="primary" @click="handleSubmit" :loading="!isCanSubmit") 确定
</template>

<script>
import { WorkFlowApi } from '../../WorkFlow.api.js';
import _cloneDeep from 'clone-deep';
import { scheduleThead } from '../../tableHead.js';
export default {
  name: '',

  props: {
  },

  data () {
    return {
      isShowProgressModal: false,
      isCanSubmit: true,
      record: null,
      thead: _cloneDeep(scheduleThead),
      tableData: [],
      selectedId: [], // 勾选的id集合,array格式
      selectedArr: [], // 勾选的id, name数组集合
      tableComone: {
        pageIndex: 1,
        totalRows: 0,
        pageSize: 10
      },
    }
  },

  watch: {
  },

  mounted () {
  },

  methods: {
    show () {
      this.tableData = []
      this.isShowProgressModal = true
    },

    cancel () {
      this.isShowProgressModal = false
    },

    // 分页页码变动
    onChangePage (val) {
      this.tableComone.pageIndex = val
      this.query()
    },

    // 分页页码变动
    onpageSizeChange (val) {
      this.tableComone.pageIndex = 1
      this.tableComone.pageSize = val
      this.query()
    },

    // 获取列表
    query(primaryKeyID) {
      var params = {
        primaryKeyID: primaryKeyID,
        HasPaging: true,
        PageIndex: this.tableComone.pageIndex,
        PageSize: this.tableComone.pageSize,
      }
      WorkFlowApi.ScheduleView(params).then(resp => {
        console.log('%c resp: ', 'color:red', resp)
        if (resp.data.success) {
          this.tableData = resp.data.data
        } else {
          this.$Message.error({
            content: resp.data.message,
            duration: 10,
            closable: true
          })
        }
      })
    },
  }
}
</script>

<style lang="less" scope>
.action-icon{
  width: 28px;
  height: 25px;
  line-height: 23px;
  color: #c5c8ce;
  background-color: #f7f7f7;
  border: solid 1px #dcdee2;
  text-align: center;
  font-size: 14px;
  border-radius: 3px;
  transition: all .3s;
  cursor: pointer;
  padding: 0;
  &:hover{
    color: #fff;
    background-color: #2d8cf0;
    border-color: #2d8cf0;
  }
}
</style>
